package com.sphd.restaurantsystem.presenter;


import com.android.volley.VolleyError;
import com.sphd.restaurantsystem.info.GoodSellInorOutInfo;
import com.sphd.restaurantsystem.model.GoodSellInorOutModelImpl;
import com.sphd.restaurantsystem.view.GoodSellInorOutView;

import java.util.List;

/**
* Created by Hu on 2016/12/26
*/

public class GoodSellInorOutPresenterImpl implements GoodSellInorOutPresenter {
    GoodSellInorOutModelImpl goodSellInorOutModel;
    GoodSellInorOutView goodSellInorOutView;

    public GoodSellInorOutPresenterImpl(GoodSellInorOutView goodSellInorOutView) {
        this.goodSellInorOutView = goodSellInorOutView;
        goodSellInorOutModel=new GoodSellInorOutModelImpl();
    }

    @Override
    public void addData(String url) {
        goodSellInorOutView.showLoading();
        goodSellInorOutModel.sendUrl(url,this);
    }

    @Override
    public void sendError(VolleyError error) {
        goodSellInorOutView.dissLoading();
    }

    @Override
    public void sendList(List<GoodSellInorOutInfo> goodSellInorOutInfos) {
        goodSellInorOutView.recList(goodSellInorOutInfos);
        goodSellInorOutView.dissLoading();
    }
}